//
//  XYDog.m
//  str
//
//  Created by qianfeng on 15/8/7.
//  Copyright (c) 2015年 qianfeng. All rights reserved.
//
//1：创建一个数组，元素是5个Dog 类的对象地址，遍历数组，是每个元素都执行bark函数,bark函数可以打印出dog 的姓名和年龄
#import "XYDog.h"

@implementation XYDog
- (id)initWithName:(NSString *)name andAge:(NSUInteger)age{
    self = [super init];
    if (self) {
        _name = name;
        _age = age;
    }
    return self;
}

-(void)bark{
  
    NSLog(@"名字:%@ 年龄:%lu",_name,_age);
}

- (NSString *)description{

    return [NSString stringWithFormat:@"%@ %lu",_name,_age];
}
   
-(void)PrintDogVoice{

    NSLog(@"Wang Wang Wang!");
}
@end
